﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WebEntities.Models.ProductInfo
{
    public class ProductCata
    {
        public int ProdCataID { get; set; }
        public string ProdCataName { get; set; }
        public int? ParentCataID { get; set; }
        public string ParentCataName { get; set; }
        public string CataDescr { get; set; }
        public DateTime CreateTime { get; set; }
        public string Creator { get; set; }
        public int? SortNum { get; set; }

        public static ProductCata AsProductCata(PP_ProductCata ppcata, string parentCataName)
        {
            ProductCata pcata = new ProductCata
            {
                ProdCataID = ppcata.ProdCataID,
                ProdCataName = ppcata.ProdCataName,
                ParentCataID = ppcata.ParentCataID,
                ParentCataName = parentCataName,
                CataDescr = ppcata.CataDescr,
                CreateTime = ppcata.CreateTime,
                Creator = ppcata.Creator,
                SortNum = ppcata.SortNum
            };
            return pcata;
        }
    }
}
